package com.dubbo.provider.consumer;

import com.dubbo.provider.entity.Invocation;
import com.dubbo.provider.service.UserService;



import java.io.IOException;

/**
 * @description:
 * @author: 石亚宁
 * @create: 2020-05-28 17:15
 **/

public class ConsumerApplication {
	public static void main(String[] args) {
		HttpClient httpClient=new HttpClient();
		Invocation invocation=new Invocation();
		invocation.setInterfaceName(UserService.class.getName());
		invocation.setMethodName("sayHello");
		invocation.setParameters(new Object[]{"你好"});
		invocation.setParametersTypes(new Class[]{String.class});
		try {
			String result = httpClient.send("localhost", 8080, invocation);
			System.out.println(result);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
